@extends('layouts.app')

@section('title','Createtrains')

@section('content')
<div class="container">
        <div class="row">
            <div class="col-md-12">

                <header class="list-header">
                        <a href="{{route('train.index')}}"><i class="fa fa-arrow-circle-left fa-lg" aria-hidden="true"></i>返回</a>
                </header>
                {!! Form::open(['route' => 'train.store', 'files' => true]) !!}
                            {{ csrf_field() }}
                    <div class="form-group{{ $errors->has('train_name')?'has-error':'' }}">
                        {!! Form::label('train_name', '培训名称:')!!}
                        {!! Form::text('train_name',null,['class'=>'form-control'])!!}
                        @if ($errors->has('train_name'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_name') }}</strong>
                            </span>
                            @endif
                    </div>
                    <div class="form-group">
                        {!! Form::label('train_picture','培训图片')!!}
                        {!! Form::file('train_picture') !!}
                        @if ($errors->has('train_picture'))
                            <div class="help-block">
                                <strong>{{ $errors->first('train_picture') }}</strong>
                            </div>
                        @endif
                    </div>
                    <div class="form-group{{ $errors->has('train_intro')?'has-error':'' }}">
                        {!! Form::label('train_intro','培训简介:') !!}
                        {!! Form::textarea('train_intro',null,['class'=>'form-control']) !!}
                        @if ($errors->has('train_intro'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_intro') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="form-group{{ $errors->has('train_rules')?'has-error':'' }}">
                        {!! Form::label('train_rules', '培训规则:')!!}
                        {!! Form::text('train_rules',null,['class'=>'form-control'])!!}
                        @if ($errors->has('train_rules'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_rules') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="form-group{{ $errors->has('train_date')?'has-error':'' }}">
                       {!! Form::label('train_date','培训时间:') !!}
                        {!! Form::text('train_date',null,['class'=>'form-control']) !!}
                        @if ($errors->has('train_date'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_date') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="form-group{{ $errors->has('train_address')?'has-error':'' }}">
                        {!! Form::label('train_address','培训地址:') !!}
                        {!! Form::text('train_address',null,['class'=>'form-control']) !!}
                        @if ($errors->has('train_address'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_address') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="form-group{{ $errors->has('train_price')?'has-error':'' }}">
                        {!! Form::label('train_price','培训收费:') !!}
                        {!! Form::number('train_price',null,['class'=>'form-control']) !!}
                        @if ($errors->has('train_price'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_price') }}</strong>
                            </span>
                        @endif
                    </div>
                        <div class="form-group{{ $errors->has('counts')?'has-error':'' }}">
                        {!! Form::label('counts','报名人数') !!}
                        {!! Form::number('counts',null,['class'=>'form-control']) !!}
                        @if ($errors->has('counts'))
                            <span class="help-block">
                                <strong>{{ $errors->first('counts') }}</strong>
                            </span>
                        @endif
                    </div>

                    <div class="form-group{{ $errors->has('train_classify')?'has-error':'' }}">
                        {!! Form::label('train_classify','培训等级:') !!}
                        {!! Form::number('train_classify',null,['class'=>'form-control']) !!}
                        @if ($errors->has('train_classify'))
                            <span class="help-block">
                                <strong>{{ $errors->first('train_classify') }}</strong>
                            </span>
                        @endif
                    </div>
                    
                    {!! Form::submit('添加培训',['class'=>"btn btn-success"]); !!}
                    {!! Form::close() !!}            
                </div>
                <div id="debug"></div>
        </div>
</div>

@endsection